<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>js算法和效率测试!</title>
  <style type="text/css">
		#modal2{
				background:#fff;
		}
  </style>	
 </head>
 <body>
 <img src="http://fanyi.baidu.com/static/translation/img/header/logo_cbfea26.png" alt="2" />
 <h1>hahh</h1>
 <div id="modal1"></div>
 <div id="modal2" >
		wwwwwwwww
 </div>
 <div id="modal2" >
		wwwwwwwww
 </div>

  
 <div class="modal">22222</div>
 <div class="modal"><a href="#">3333333</a></div>

  <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
  <script type="text/javascript">

		var xx = document.querySelectorAll('#modal2')[1];
		$(xx).html("hahahaha1");
		var arr = [],
		max = 1000;
		for (var i = 1; arr.push(i++) < max;);

		var mapArr = [],forEachArr = [],forArr = [];

		console.time('map');
		arr.map(function (val) {
		  mapArr.push(val);
		})
		console.timeEnd('map');

		console.time('forEach');
		arr.forEach(function (val) {
		  forEachArr.push(val);
		})
		console.timeEnd('forEach');

		console.time('for');
		for (var i = 0; i < arr.length; i++) {
		  forArr.push(arr[i]);
		}
		console.timeEnd('for');
  </script>
 </body>
</html>
